package com.flyou.ccnucenter.ui.activity.aboutActivity;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.flyou.ccnucenter.Constant;
import com.flyou.ccnucenter.R;
import com.flyou.ccnucenter.ui.activity.BaseActivity1;
import com.flyou.ccnucenter.ui.activity.webView.WebViewActivity;

public class AboutActivity extends BaseActivity1 implements View.OnClickListener {
    private static String HENU_GENERAL_SITUATION = "http://mp.weixin.qq.com/s?__biz=MjM5ODIwOTEyMA==&mid=10000322&idx=1&sn=d54c772fd2c9eca6cd8deb4776d2d543#wechat_redirect";
    private static String HENU_HISTORY = "http://mp.weixin.qq.com/s?__biz=MjM5ODIwOTEyMA==&mid=10000322&idx=2&sn=cf922a157001ec57a1f3402adb44077a#wechat_redirect";
    private static String HENU_SONG = "http://mp.weixin.qq.com/s?__biz=MjM5ODIwOTEyMA==&mid=10000322&idx=3&sn=f8c9abed621e8bd1f9264f8d62c3952a#wechat_redirect";
    private static String HENU_STYLE = "http://mp.weixin.qq.com/s?__biz=MjM5ODIwOTEyMA==&mid=10000322&idx=4&sn=e1136b17be23508071b24721ad0e9aa7#wechat_redirect";
    private static String HENU_CELEBRATE = "http://mp.weixin.qq.com/s?__biz=MjM5ODIwOTEyMA==&mid=10000322&idx=5&sn=b3d499dbc9e863793a240317051233a9#wechat_redirect";

    private RelativeLayout mTitlebarRlBack;
    private RelativeLayout titlebar_rl_Right;
    private ImageView iv_right_image;
    private TextView mTitlebarTvTitle;
    private android.widget.RelativeLayout rlabouthenu;
    private android.widget.TextView henuhistory;
    private android.widget.TextView henusong;
    private android.widget.TextView henustyle;
    private android.widget.TextView henuvideo;

    @Override
    protected void initView() {
        setContentView(R.layout.activity_about);
        mTitlebarRlBack = (RelativeLayout) findViewById(R.id.titlebar_rl_back);
        titlebar_rl_Right = (RelativeLayout) findViewById(R.id.titlebar_rl_Right);
        iv_right_image = (ImageView) findViewById(R.id.iv_right_image);
        mTitlebarTvTitle = (TextView) findViewById(R.id.titlebar_tv_title);
        this.henuvideo = (TextView) findViewById(R.id.henu_video);
        this.henustyle = (TextView) findViewById(R.id.henu_style);
        this.henusong = (TextView) findViewById(R.id.henu_song);
        this.henuhistory = (TextView) findViewById(R.id.henu_history);
        this.rlabouthenu = (RelativeLayout) findViewById(R.id.rl_about_henu);

    }

    @Override
    protected void initDate() {
        mTitlebarTvTitle.setText("关于");
        titlebar_rl_Right.setVisibility(View.VISIBLE);
        iv_right_image.setImageResource(R.drawable.about_me);


    }

    @Override
    protected void setListener() {
        mTitlebarRlBack.setOnClickListener(new Finish());
        henuvideo.setOnClickListener(this);
        henustyle.setOnClickListener(this);
        henusong.setOnClickListener(this);
        henuhistory.setOnClickListener(this);
        rlabouthenu.setOnClickListener(this);
        titlebar_rl_Right.setOnClickListener(new AboutMe());
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        intent.setClass(AboutActivity.this, AboutWebViewActivity.class);
        switch (v.getId()) {

            case R.id.rl_about_henu:
                intent.putExtra("url", HENU_GENERAL_SITUATION);
                intent.putExtra("title", "学校概况");
                break;
            case R.id.henu_history:
                intent.putExtra("url", HENU_HISTORY);
                intent.putExtra("title", "历史沿革");
                break;
            case R.id.henu_video:
                intent.putExtra("url", HENU_CELEBRATE);
                intent.putExtra("title", "校庆晚会");
                break;
            case R.id.henu_style:
                intent.putExtra("url", HENU_STYLE);
                intent.putExtra("title", "校训校风");

                break;
            case R.id.henu_song:
                intent.putExtra("url", HENU_SONG);
                intent.putExtra("title", "河大校歌");
                break;



        }
        startActivity(intent);
    }

    public class Finish implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            finish();
        }
    }

    public class AboutMe implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            Intent aboutMeIntent = new Intent(AboutActivity.this, WebViewActivity.class);
            aboutMeIntent.putExtra("title", "关于作者");
            aboutMeIntent.putExtra("url", Constant.BASE_URL + Constant.ABOUT_ME);
            startActivity(aboutMeIntent);

        }
    }
}
